apply if else in matlab with examples